import request from '@/utils/request'

// 查询传感器列表
export function listSensor(query) {
  return request({
    url: '/slope/sensor/list',
    method: 'get',
    params: query
  })
}

// 查询传感器详细
export function getSensor(sensorId) {
  return request({
    url: '/slope/sensor/' + sensorId,
    method: 'get'
  })
}

// 新增传感器
export function addSensor(data) {
  return request({
    url: '/slope/sensor',
    method: 'post',
    data: data
  })
}

// 修改传感器
export function updateSensor(data) {
  return request({
    url: '/slope/sensor/edit',
    method: 'post',
    data: data
  })
}

// 删除传感器
export function deleteSensor(sensorIds) {
  return request({
    url: '/slope/sensor/remove/' + sensorIds,
    method: 'post'
  })
}

// 导出传感器
export function exportSensor(query) {
  return request({
    url: '/slope/sensor/export',
    method: 'get',
    params: query
  })
}

// 下载传感器模板
export function importTemplate(query) {
  return request({
    url: '/slope/sensor/downloadModel',
    method: 'get',
    params: query
  })
}

// 导入传感器
export function importSensor(query) {
  return request({
    url: '/slope/device/importData',
    method: 'post',
    params: query
  })
}

//禁用启用传感器
export function changeIsValid(data) {
  return request({
    url:'/slope/sensor/changeIsValid',
    method:'post',
    data:data
  })
}


// 检测imei是否重复
export function checkIMEI(imei) {
  return request({
    url: '/slope/sensor/checkIMEI?imei=' + imei,
    method: 'get'
  })
}